#!/bin/bash

#   Copyright 2012 Marcin Litwiński
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.


# Universal Server Admin Tool v1.0
# by Marcin Litwiński
# marci.litwinski@gmail.com litwinski@white-paper-media.de
# Apache License 2.0

cmd=(dialog --title "Universal Server Admin Tool v1.0" --radiolist "Select options:" 22 76 16)
options=(1 "Check for update and install it" off    # any option can be set to default to "on"
         2 "Check only for update, don't install it" off
	 3 "Gitorious migration" off
	 4 "Go to main installation menu" off
	 5 "Exit" off)

choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear

for choice in $choices
do
    case $choice in
        1)
            apt-get update && apt-get upgrade -y && ./skr_test.sh
		;;
        2)
            apt-get update && ./skr_test.sh
		;;
	3)
	    ./git_migration.sh
		;;
	4)
	    ./skr_test.sh
		;;
    esac
done
